<template>
	<view style="color: #B75D62;">
		<view class="main">
			<view class="top">
				<view class="cu-avatar round lg margin-right"  :style="{backgroundImage: 'url('+ $wanlshop.oss(storeInfo.image, 42, 42, 2) +')'}"></view> 
				<view class="user" @tap="$wanlshop.auth('/pages/user2/partner/storeinfo')">
				   <text style="float: left;">{{storeInfo.store}} </text>
				   <image style="width: 50rpx;height: 50rpx;float: left;margin-left: 10px;" :src="$wanlshop.oss('/OSS/20240812/d15084649dad243796f766b2b2f85e97.png',40,40,1,'image','png')"></image><br/> 
				 <!--  <text class="rq" style="display: inline-block;">vip至：</text> -->
				</view>	
				<text v-if="user.id == storeInfo.user_id" class="wlIcon-shezhi" style="position: absolute;right: 60rpx;top:50rpx" @tap="$wanlshop.auth(`/pages/user2/partner/storesetting?data=${JSON.stringify(store)}`)">设置</text>
			</view>
	    </view>
		
		<view class="activity padding-bj">
			<view class="bg-white radius grid text-center col-3 padding-lr-bj padding-tb-sm" style="font-size: 28rpx;border-radius: 5px;">
				<view class="flex justify-center" style="width: 20%;"  @tap="$wanlshop.auth(`/pages/user2/partner/store/offinesorder?state=0&id=${id}`)">
					<view class="content" style="height: 120rpx">
					    <text class="wlIcon-31daishouhuo red1" style="font-size: 48rpx;"></text>
						<view class="red1 text-bold6" style="margin-top: 6px;">订单管理</view>						
					</view>
				</view>
				<view class="flex justify-center" style="width: 20%;">
					<view class="content" style="height: 120rpx">
					    <text class="wlIcon-yunshuzhong red1" style="font-size: 48rpx;"></text>
						<view class="red1 text-bold6" style="margin-top: 6px;">仓库管理</view>						
					</view>
				</view>
	
			</view>
		</view>
		
	</view>
	
</template>

<script>
	import { mapState } from 'vuex';
	export default {
		data() {
			return {
				id:0,
				storeInfo:{},
				store:{}
			}
		},
		computed: {
			...mapState(['user'])		
		},
		onLoad(option) {
			if('id' in option){
				this.id = option.id;
			}
			this.loadData();
		},
		onShow() {
			
		},
		methods: {	
			async loadData() {
				await uni.request({		
					url: '/wanlshop/user/getStoreInfo?id='+this.id,	
					method:'GET',
					success: res => {
						this.storeInfo = res.data;
						this.store.store = res.data.store;
						this.store.id = res.data.id;
						this.store.image = res.data.image;
						this.store.truename = res.data.truename;
						this.store.address_city = res.data.address_detail;
						this.store.remark = res.data.remark;
					}
			    }) 
			}
		}
	}
</script>

<style>
	.main{
		font-family: OPPOSans Medium;		
		padding: 40rpx;
		position: relative;		
		padding-top: 20rpx;
	}
	.main .top{
		left: 16rpx;
		top: 26rpx;
		display: flex;
	}
	.top .cu-avatar,.top .user{
		font-size: 32rpx;
		float: left;
		margin-left: 5px;
		position: relative;
		line-height: 50rpx;
	} 
	.top .cu-avatar,.top .user .rq{
		font-size: 30rpx;
	} 
	.top .cu-avatar{
		width: 100rpx;
		height: 100rpx;
		margin: 8rpx;
	}
	.top .user{
		margin-top: 8rpx;		
		font-weight: 600;
	}
	.main .image{
		clear: both;
		margin-top: 15px;
		display: flex;
	}
	
	.main .image .t3 .sz{
		color: #F54D4C;
		font-weight: 600;
		font-size: 18px;
		padding-left: 10px;
	}
	.main .image .t3 .btm{
		margin-top: 15px;
	}
	.title{
		margin-bottom: 15px;
		color: #B75D62;
		font-weight: 600;
	}
	.order .item{
		width: 30%;
		margin-right: 3%;
		padding: 5px 10px;
		background-color: #CE7976;
		float: left;
		text-align: center;
		border-radius: 3px;
		color: #ffffff;
		font-weight: 600;
	}
	.content .red1{
		color: #B75D62;
	}
</style>

